package utils
{
	
	/**
	 * @author Kirill Pletnev
	 */
	public class Utils
	{
		public static function getFilenameByURL(url:String):String
		{
			return url.slice(Math.max(url.lastIndexOf('/'), url.lastIndexOf('\\')) + 1);
		}
		
		public static function getFormattedTime():String
		{
			var time:Date = new Date();
			var ms:int = time.getUTCMilliseconds();
			var s:int = time.getUTCSeconds();
			var m:int = time.getUTCMinutes();
			var h:int = time.getUTCHours();
			var timeStr:String = h + ":" + m + ":" + s + ":" + ms;
			return timeStr;
		}
		
		public static function remove(data:Object, item:Object):void
		{
			var index:int = data.indexOf(item);
			if (data is Array)
			{
				var array:Array = data as Array;
				array.splice(index, 1);
			}
			else if (data is Vector)
			{
				var vector:Vector = data as Vector;
				vector.splice(index, 1);
			}
		}
	}

}